unit ASetField;

interface

uses
  AData,
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, AModelBrowser, Menus, ActnList, frxClass, frxDesgn, ComCtrls,
  ToolWin, dxSkinsCore, dxSkinsDefaultPainters, dxSkinscxPCPainter,
  
  cxEdit, DB, cxDBData, DBAccess, MyAccess, MemDS, 
  cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
  cxGridDBTableView, cxGrid, ExtCtrls, cxSplitter, cxContainer, cxGroupBox,
  DBCtrls, cxTextEdit, cxDBEdit, Grids, Wwdbigrd, Wwdbgrid, StdCtrls,
  DBClient, Provider;

type
  TASetFieldForm = class(TAModelBrowserFrame)
    Qsys_Fields: TMyQuery;
    Dsys_Fields: TMyDataSource;
    cxSplitter1: TcxSplitter;
    Panel1: TPanel;
    cxSplitter2: TcxSplitter;
    cxGroupBox1: TcxGroupBox;
    cxGroupBox2: TcxGroupBox;
    Qsys_fieldvalues: TMyQuery;
    Dsys_fieldvalues: TMyDataSource;
    wwDBGrid1: TwwDBGrid;
    Qsys_fieldvaluesauto_no: TIntegerField;
    Qsys_fieldvaluesField_Name: TStringField;
    Qsys_fieldvaluesField_values: TStringField;
    Field_Name: TLabel;
    Field_Desc: TLabel;
    Field_Length: TLabel;
    cxDBTextEdit1: TcxDBTextEdit;
    cxDBTextEdit2: TcxDBTextEdit;
    cxDBTextEdit3: TcxDBTextEdit;
    CDSsys_Fields: TClientDataSet;
    dtstprvdr1: TDataSetProvider;
    CDSsys_FieldsField_Name: TStringField;
    CDSsys_FieldsField_Desc: TStringField;
    CDSsys_FieldsDisplay_Format: TStringField;
    CDSsys_FieldsEdit_Format: TStringField;
    CDSsys_FieldsField_Tag: TIntegerField;
    CDSsys_FieldsField_Type: TStringField;
    CDSsys_FieldsField_Length: TIntegerField;
    CDSsys_FieldsDefault_Value: TStringField;
    CDSsys_FieldsField_Roles: TIntegerField;
    wwDBGrid2: TwwDBGrid;
    btn1: TButton;
    MyDataSource1: TMyDataSource;
    procedure ActionSaveExecute(Sender: TObject);
    procedure btn1Click(Sender: TObject);
  private

  public
    constructor Create(Aowner: TComponent); override;
  end;

var
  ASetFieldForm: TASetFieldForm;

implementation

{$R *.dfm}

procedure TASetFieldForm.ActionSaveExecute(Sender: TObject);
begin
  inherited;
   ADMSystem.QAPubFields.Refresh;
end;

constructor TASetFieldForm.Create(Aowner: TComponent);
begin
  inherited;
  FUseClientDS := True;
end;

procedure TASetFieldForm.btn1Click(Sender: TObject);
begin
  inherited;

  MyDataSource1.DataSet := FActiveCDSDelta;
  if CDSsys_Fields.ChangeCount <> 0 then
  FActiveCDSDelta.Data := CDSsys_Fields.Delta
  else FActiveCDSDelta.Refresh;

end;

initialization
  RegisterClass(TASetFieldForm);
finalization
  UnRegisterClass(TASetFieldForm);

end.

